#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;

class Equation
{
private:
    double a, b, c;

public:
    Equation()
    {
        a = 1.0;
        b = 1.0;
        c = 0;
    }
    Equation(double a, double b, double c)
    {
        this->a = a;
        this->b = b;
        this->c = c;
    }
    double getA()
    {
        return a;
    }
    double getB()
    {
        return b;
    }
    double getC()
    {
        return c;
    }
    double getDiscriminant()
    {
        return b * b - 4 * a * c;
    }
    double getRoot1()
    {
        return (-b + sqrt(getDiscriminant())) / (2 * a);
    }
    double getRoot2()
    {
        return (-b - sqrt(getDiscriminant())) / (2 * a);
    }
};

int main()
{
    double a, b, c;
    int t;
    cin >> t;
    while (t--)
    {
        cin >> a >> b >> c;
        Equation eq(a, b, c);
        if (eq.getDiscriminant() < 0)
        {
            cout << "x1=" << (-1 * eq.getB()) / (2 * eq.getA()) << "+" << sqrt(-1 * eq.getDiscriminant()) / (2 * eq.getA()) << "i ";
            cout << "x2=" << (-1 * eq.getB()) / (2 * eq.getA()) << "-" << sqrt(-1 * eq.getDiscriminant()) / (2 * eq.getA()) << "i" << endl;
        }
        else if (eq.getDiscriminant() == 0)
        {
            cout << "x1=x2=" << fixed << setprecision(2) << eq.getRoot1() << endl;
        }
        else
        {
            cout << "x1=" << fixed << setprecision(2) << eq.getRoot1() << " x2=" << eq.getRoot2() << endl;
        }
    }

    return 0;
}

/*

*/